package be.jabapage.snooker.jdo.competition;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import lombok.Data;

@PersistenceCapable(detachable = "true")
@Data
public class SubCompetition {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;

	/**
	 * some indicator to differentiate all the subcompetitions of one competition.
	 * for instance: 1A ==> A is the indicator.
	 */
	@Persistent
	private char indicator;

	/**
	 * This together with {@link SubCompetition#endSeason} defines the period that the subcompetition is active.
	 * If we need a second period, the first one will be overwritten.
	 */
	@Persistent
	private String startSeason;

	/**
	 * See at {@link SubCompetition#startSeason} for the explanation.
	 */
	@Persistent
	private String endSeason;

	@Persistent
	private Long competitionId;
}
